﻿using System.Windows;

namespace XamlMvp.Controls
{
    public sealed class View
    {
        public static readonly DependencyProperty PresenterProperty = DependencyProperty.RegisterAttached("Presenter", typeof(PresenterBinding), typeof(View), new PropertyMetadata(null));
        public static readonly DependencyProperty AutoEventWireUpProperty = DependencyProperty.RegisterAttached("AutoEventWireUp", typeof(bool), typeof(View), new PropertyMetadata(false));

        public static PresenterBinding GetPresenter(UIElement element)
        {
            return (PresenterBinding)element.GetValue(PresenterProperty);
        }

        public static void SetPresenter(UIElement element, PresenterBinding value)
        {
            element.SetValue(PresenterProperty, value);
        }

        public static bool GetAutoEventWireUp(UIElement element)
        {
            return (bool)element.GetValue(AutoEventWireUpProperty);
        }

        public static void SetAutoEventWireUp(UIElement element, bool value)
        {
            element.SetValue(AutoEventWireUpProperty, value);
        }
    }
}
